/*
 * @Author: Await
 * @Date: 2024-11-14 19:49:45
 * @LastEditors: Await
 * @LastEditTime: 2024-11-17 09:39:04
 * @Description: 请填写简介
 */
import { request } from '@/service/request';

/**
 * 获取用户视图列表
 */
export function getJellyfinTypeList(id: string) {
  return request<Api.Jellyfin.UserViews>({
    url: `Jellyfins/UserViews/${id}`
  });
}

/**
 * 获取媒体项列表
 */
export function getVideoList(id: string, params?: Api.Jellyfin.QueryParams) {
  return request<Api.Jellyfin.Info>({
    url: `Jellyfins/Items/${id}`,
    method: 'get',
    params: {
      ...params,
      userId: id
    }
  });
}

// /**
//  * 获取媒体项详情
//  */
// export function getItemDetail(id: string) {
//   return request<Api.Jellyfin.ItemDetail>({
//     url: `Jellyfins/ItemDetail/${id}`
//   });
// }

/**
 * 获取子项列表
 */
export function getChildren(id: string) {
  return request<Api.Jellyfin.Info>({
    url: `Jellyfins/Children/${id}`,
    method: 'get'
  });
}

// /**
//  * 获取媒体流
//  */
// export function getStream(id: string) {
//   return request<Blob>({
//     url: `Jellyfins/Stream/${id}`,
//     responseType: 'blob'
//   });
// }

/**
 * 获取图片
 */
export function getItemImage(id: string, itemId: string, imageType: string) {
  return undefined;
  // return request<Blob>({
  //   url: `Jellyfins/Images/${id}`,
  //   method: 'get',
  //   params: {
  //     itemId,
  //     imageType
  //   },
  //   responseType: 'blob'
  // });
}


